﻿/*
 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.
 */

#include "PortBase.h"

PortBase::PortBase(QObject *parent)
    : QObject(parent)
{
}

PortBase::~PortBase()
{
}

bool PortBase::InitPort(PortBaseInitStru &portFactionInit)
{
    Q_UNUSED(portFactionInit);
    return TRUE;
}

ErrorSettingCom PortBase::InitPortConfigure(UINT stopbits, UINT flowctrl, UINT baud,
                                            QSerialPort::Parity parity, UINT databits)
{
    Q_UNUSED(stopbits);
    Q_UNUSED(flowctrl);
    Q_UNUSED(baud);
    Q_UNUSED(parity);
    Q_UNUSED(databits);
    return ErrorSettingCom::ERROR_SETTING_COM_SUCCESS;
}

BOOL PortBase::ReInitPort()
{
    return TRUE;
}

BOOL PortBase::StartMonitoring()
{
    return TRUE;
}

BOOL PortBase::RestartMonitoring()
{
    return TRUE;
}

BOOL PortBase::StopMonitoring()
{
    return TRUE;
}

void PortBase::WriteToPort(LPCTSTR string)
{
    Q_UNUSED(string);
}

void PortBase::WriteToPort(const char *string, int n)
{
    Q_UNUSED(string);
    Q_UNUSED(n);
}

bool PortBase::IsThreadAlive() const
{
    return true;
}

void PortBase::SetOneTimeReadByte(DWORD oneTimeReadByte)
{
    Q_UNUSED(oneTimeReadByte);
}

void PortBase::ClosePort()
{
}

bool PortBase::SetFlowCtrl(UINT flowctrl)
{
    Q_UNUSED(flowctrl);
    return true;
}

bool PortBase::SetStopBits(UINT stopBits)
{
    Q_UNUSED(stopBits);
    return true;
}

bool PortBase::SetDataBits(UINT dataBits)
{
    Q_UNUSED(dataBits);
    return true;
}
